const mongoose = require('mongoose');
// 创建集合规则
const studentsSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true,
        minlength: 2,
        maxlength: 10
    },
    age: Number,
    sex: String,
    email: String,
    hobbies: [String],
    college: String,
    enterdate: {
        type: Date,
        default: Date.now
    }
});
// 创建集合
const Student = mongoose.model('Student', studentsSchema);

module.exports = Student;